package com.dancw.service.user.basic.controller;

import com.dancw.user.model.basic.BasicUserDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 但成王
 * @create 2018-11-01 23:48
 */
@Api(value = "UserBasicController", description = "用户基本信息")
@RestController
@RequestMapping(value = "/user/basic")
public class UserBasicController {

    @ApiOperation(value = "用户信息列表",notes = "查询用户信息列表接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户编号", required = true, dataType = "long")
    })
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    public List<BasicUserDTO> list(@RequestParam(value = "userId") Long userId) {
        System.out.println("=====userId=====" + userId);

        List<BasicUserDTO> dtos = new ArrayList<>();
        BasicUserDTO dto = new BasicUserDTO();
        dto.setAge(12);
        dto.setPassword("1212");
        dto.setUserName("张三");
        dtos.add(dto);
        dto = new BasicUserDTO();
        dto.setAge(13);
        dto.setPassword("1212");
        dto.setUserName("王五");
        dtos.add(dto);
        dto = new BasicUserDTO();
        dto.setAge(12);
        dto.setPassword("1212");
        dto.setUserName("老刘");
        dtos.add(dto);
        return dtos;
    }
}
